<template>
  <el-card shadow="hover">
    <span slot="header">老年卡</span>
    <el-row>
      <el-col :span="5">证号</el-col>
      <el-col :span="15">
        {{cardInfo.code}}
      </el-col>
    </el-row>
    <el-row>
      <el-col :span="5">姓名</el-col>
      <el-col :span="15">
        {{cardInfo.realName}}
      </el-col>
    </el-row>
    <el-row>
      <el-col :span="5">身份证号</el-col>
      <el-col :span="15">
        {{cardInfo.idcard}}
      </el-col>
    </el-row>
    <el-row>
      <el-col :span="5">余额</el-col>
      <el-col :span="15" class="balance">
        {{balance ? (+balance).toFixed(2) : '-'}}
      </el-col>
    </el-row>
  </el-card>
</template>

<script>

export default {
  props: {
    cardInfo: Object,
    balanceValue: null
  },
  data() {
    return {
      balance: this.balanceValue,
      info: this.cardInfo
    }
  },
  watch: {
    balanceValue(v) {
      this.balance = v;
    }
  }
}
</script>

<style scoped>
.el-card {
  width: 400px;
  height: 184px;
  border-radius: 8px;
  font-size: 14px;
}
.el-card >>> .el-card__header {
  padding: 8px 20px;
}
.el-card >>> .el-card__body {
  padding: 10px 20px;
}
.el-card >>> .el-row {
  line-height: 32px;
}

.balance {
  color: #ffb980;
  font-size: 16px;
  font-weight: bold;
}
</style>